package com.test.springai.controller;

import org.springframework.ai.ollama.OllamaChatModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created with IntelliJ IDEA.
 *
 * @description:
 * @author: liuziyang
 * @since: 8/19/25 11:10 AM
 * @modifiedBy:
 * @version: 1.0
 */
@RestController
public class OllamaController {
  @Autowired private OllamaChatModel chatModel;

  @GetMapping(value = "/ollama")
  public String ollama(@RequestParam(value = "msg", defaultValue = "你是谁") String msg) {
    return chatModel.call(msg);
  }
}
